package com.java.controller.api;


import com.java.pojo.entity.LendReturn;
import com.java.pojo.entity.TransFlow;
import com.java.result.Result;
import com.java.service.TransFlowService;
import com.java.utils.JwtUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 交易流水表 前端控制器
 * </p>
 *
 * @author Helen
 * @since 2021-07-08
 */
@RestController
@RequestMapping("/api/core/transFlow")
public class TransFlowController {

    @Resource
    private TransFlowService transFlowService;

    //资金记录
    @ApiOperation("资金记录列表")
    @GetMapping("/list")
    public Result transflowList(HttpServletRequest request){
        String token = request.getHeader("token");
        Long userId = JwtUtils.getUserId(token);
        List<TransFlow> transFlowList = transFlowService.getList(userId);
        return Result.ok(transFlowList);
    }
}

